<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page pageEncoding="UTF-8" contentType="text/html;charset=UTF-8" %>
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<title>展示饮品信息</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/css/style.css" />
	</head>
	<body>
		<div id="wrap">
			<div id="top_content"> 
				<div id="header">
					<div id="rightheader">
						<p>
							2009/11/20
							<br />
						</p>
					</div>
					<div id="topheader">
						<h1 id="title">
							<a href="#">main</a> 
						</h1>
					</div>
					<div id="navigation">
					</div>
				</div>
				<div id="content">
					<p id="whereami">
					</p>
					<h1>
						Welcome!
					</h1>
					<form method="post" action="${pageContext.request.contextPath}/tea/MulDeleteTea.do">
					<table class="table">
						<tr class="table_header">
						    <td>
							   	全选
							</td>
							<td>
								编号
							</td>
							<td>
								饮品名称
							</td>
							<td>
								饮品价格
							</td>
							<td>
								上架时间
							</td>
							<td>
								类别名称
							</td>
							<td>
								操作
							</td>
						</tr>

						<c:forEach items="${requestScope.teas}" var="tea">
							<tr>
								<td>
									<input type="checkbox" name="ids" value="${tea.id}"/>
								</td>
								<td>
										${tea.id}
								</td>
								<td>
										${tea.name}
								</td>
								<td>
										${tea.price}
								</td>
								<td>
										${tea.time}
								</td>
								<td>
										${tea.tid}
								</td>
								<td>
<%--									删除需要在controller路径后拼接?id=${对象.id}点击修改先跳到查询单个控制器方便回显到修改页面，存到作用域内转发至修改jsp，--%>
									<a href="${pageContext.request.contextPath}/tea/delete.do?id=${tea.id}">删除饮品</a>&nbsp;<a href="${pageContext.request.contextPath}/tea/selectOne.do?id=${tea.id}">修改饮品</a>
								</td>
							</tr>
						</c:forEach>


					
					</table>
					  <input type="submit" value="删除勾选项"/>
					</form>
					<p>
<%--						错写为跳转至添加controller，要从jsp获取参数在controller收参--%>
						<a href="${pageContext.request.contextPath}/addTea.jsp">添加饮品</a>
						<a href="${pageContext.request.contextPath}/type/selectAllTypeAndTeaNum.do">查看所有类别</a>
					</p>
				</div>
			</div>
			<div id="footer">
				<div id="footer_bg">
				ABC@126.com
				</div>
			</div>
		</div>
	</body>
</html>
